Brooks–Iyengar algorithm